import Api from "../apis/Apis";
import Tools from "../../utils/tools";
import Http from "../../utils/http";

const enrollInfosByParams = (queryParams) => {
    const queryString = Tools.paramsToQueryString(queryParams);
    return Http.get(Api.university.enrollInfosByParams + queryString);
}


const universityDetail = (id) => {
    return Http.get(Api.university.detail + id);
}

/**
 * 获取大学招生信息 
 * @param {*} id  id=0的时候获取所有信息，id=大学id的时候获取大学信息
 * @returns 
 */
const universityEnrollInfos = (queryParams) => {
    const queryString = Tools.paramsToQueryString(queryParams);
    return Http.get(Api.university.universityEnrollInfos + queryString);
}

const UniversityService = {
    enrollInfosByParams,
    universityDetail,
    universityEnrollInfos
}

export default UniversityService;